package com.kmair.caiwu.financialexpress.service.impl;

import com.kmair.caiwu.financialexpress.dao.FinancialExpressFormationMapper;
import com.kmair.caiwu.financialexpress.pojo.FinancialExpressFormation;
import com.kmair.caiwu.financialexpress.service.DataOperationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class FinancialExpressFormationService implements DataOperationService {

    private final FinancialExpressFormationMapper dao;

    @Autowired
    public FinancialExpressFormationService(FinancialExpressFormationMapper dao) {
        this.dao = dao;
    }

    @Transactional(propagation = Propagation.REQUIRED)
    public int deleteByPrimaryKey(Integer tId) {
        return dao.deleteByPrimaryKey(tId);
    }

    @Transactional(propagation = Propagation.REQUIRED)
    public int insert(Object record) {
        return dao.insert((FinancialExpressFormation) record);
    }

    @Transactional(propagation = Propagation.REQUIRED)
    public int insertSelective(Object record) {
        return dao.insertSelective((FinancialExpressFormation) record);
    }

    @Transactional(propagation = Propagation.SUPPORTS)
    public Object selectByPrimaryKey(Integer tId) {
        return dao.selectByPrimaryKey(tId);
    }

    @Transactional(propagation = Propagation.REQUIRED)
    public int updateByPrimaryKeySelective(Object record) {
        return dao.updateByPrimaryKeySelective((FinancialExpressFormation) record);
    }

    @Transactional(propagation = Propagation.REQUIRED)
    public int updateByPrimaryKey(Object record) {
        return dao.updateByPrimaryKey((FinancialExpressFormation) record);
    }

    @Override
    @Transactional(propagation = Propagation.SUPPORTS)
    public List selectSelective(Object entity) {
        return dao.selectSelective((FinancialExpressFormation) entity);
    }
}
